package com.redfootdev.horseskills;

import org.bukkit.ChatColor;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

public class Attractiveness {

	public int horseWasGroomed(HorseDatabase hdb, PlayerDatabase pdb, Entity horse, Player rider) {
		
		// look up the horse and player attributes.
		Skill attractiveness = hdb.getAttractiveness(horse);
		// calculate the XP gain for strength.
		int xpGainAttractiveness = 200;
		// apply XP to strength Skill
		attractiveness.addXP(xpGainAttractiveness);
		if(attractiveness.addXP(xpGainAttractiveness)) {
			rider.sendMessage(ChatColor.AQUA + "Your Attractiveness level is now " + attractiveness.getLevel() + ".");
		}
		hdb.setAgility(horse, attractiveness);
		
		return xpGainAttractiveness;
		
	}
	public int horseWasWashed(HorseDatabase hdb, PlayerDatabase pdb, Entity horse, Player rider) {
		
		// look up the horse and player attributes.
		Skill attractiveness = hdb.getAttractiveness(horse);
		// calculate the XP gain for strength.
		int xpGainAttractiveness = 350;
		// apply XP to strength Skill
		if(attractiveness.addXP(xpGainAttractiveness)) {
			rider.sendMessage(ChatColor.AQUA + "Your Attractiveness level is now " + attractiveness.getLevel() + ".");
		}
		hdb.setAgility(horse, attractiveness);
		
		return xpGainAttractiveness;
		
	}
	public String toString(HorseDatabase hdb, PlayerDatabase pdb, Entity horse, Player rider) {

		Skill attractiveness = hdb.getAttractiveness(horse);


		int level = attractiveness.getLevel();
		int xp = attractiveness.getXP();

		
		String stats = "Attractiveness Level: " + level + "\nExperience: " + xp;
		return stats;
	}
}
